﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace Inovout.Account.Web.Models
{
    public class FindPasswordInfo
    {

        [Required(ErrorMessage = "用户名不可为空")]
        [Alias("用户名")]
        public string UserName { get; set; }

        private string email;
        [Required(ErrorMessage = "邮箱地址不可为空")]
        [EmailAddress(ErrorMessage = "请输入正确的电子邮箱格式")]
        [Alias("邮箱地址")]
        public string Email
        {
            get
            {
                if (string.IsNullOrEmpty(email))
                {
                    return UserName;
                }
                return email;
            }
            set
            {
                email = value;
            }
        }
    }
}